﻿/// <reference path="../../StringBuilder.js" />

RegExp.Escape = function Escape(str)
{
	var sb = new StringBuilder();
	for (var i = 0; i < str.length; ++i)
	{
		if ("\\*+?[](){}.-".Contains(str.charAt(i)))
			sb.Append("\\");
		sb.Append(str.charAt(i));
	}
	return sb.toString();
}
